.chat-container {
  padding: 24px;
  height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.chat-header h1 {
  margin: 0;
  color: #1890ff;
  font-size: 28px;
  font-weight: 600;
}

.chat-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.chat-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  max-height: calc(100vh - 300px);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 300px;
  text-align: center;
}

.empty-state h3 {
  margin: 16px 0 8px 0;
  color: #1890ff;
}

.empty-state p {
  color: #666;
  margin: 0;
}

.selected-rule {
  margin-top: 16px;
  padding: 8px 16px;
  background: #f0f8ff;
  border-radius: 4px;
  border: 1px solid #d6e4ff;
}

.message-item {
  padding: 0 !important;
  border: none !important;
}

.message-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.message {
  display: flex;
  gap: 12px;
  max-width: 80%;
}

.user-message {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.ai-message {
  align-self: flex-start;
}

.user-avatar {
  background-color: #1890ff;
  flex-shrink: 0;
}

.ai-avatar {
  background-color: #52c41a;
  flex-shrink: 0;
}

.message-content {
  flex: 1;
  min-width: 0;
}

.message-text {
  padding: 12px 16px;
  border-radius: 12px;
  word-wrap: break-word;
  white-space: pre-wrap;
  line-height: 1.5;
}

.user-message .message-text {
  background-color: #1890ff;
  color: white;
  border-bottom-right-radius: 4px;
}

.ai-message .message-text {
  background-color: #f5f5f5;
  color: #333;
  border-bottom-left-radius: 4px;
}

.message-time {
  font-size: 12px;
  color: #999;
  margin-top: 4px;
  text-align: right;
}

.ai-message .message-time {
  text-align: left;
}

.loading-message {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px;
  color: #666;
  font-style: italic;
}

.input-container {
  display: flex;
  gap: 12px;
  padding: 16px;
  border-top: 1px solid #f0f0f0;
  background: #fafafa;
}

.input-container .ant-input {
  border-radius: 8px;
  resize: none;
}

.send-button {
  border-radius: 8px;
  height: auto;
  padding: 8px 16px;
  flex-shrink: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .chat-container {
    padding: 16px;
  }
  
  .chat-header {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }
  
  .chat-header h1 {
    font-size: 24px;
  }
  
  .message {
    max-width: 90%;
  }
  
  .input-container {
    flex-direction: column;
  }
  
  .send-button {
    align-self: flex-end;
  }
}

/* 滚动条样式 */
.messages-container::-webkit-scrollbar {
  width: 6px;
}

.messages-container::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.messages-container::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.messages-container::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}
